package com.fcgzs.user.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * @Auther: ljj
 * @Description:
 */
@Configuration
@EnableSwagger2  //开启swagger
public class SwaggerConfig {

    //创建swagger的说明方法
    private ApiInfo apiInfo(){
        return new ApiInfoBuilder().title("东易买电商用户模块说明文档")
                                   .description("供前端人员查看")
                                   .contact("ljj")
                                   .version("V1.0")
                                   .termsOfServiceUrl("www.ujiuye.com")
                                   .build();
    }

    //swagger的配置方法
    @Bean
    public Docket docket(){
        return new Docket(DocumentationType.SWAGGER_2).apiInfo(this.apiInfo())
                .groupName("group1")
                .select()
                .build();
    }

}
